<?php

/**
 * Created by PhpStorm.
 * User: DMF
 * Date: 2017/4/8
 * Time: 13:34
 */
namespace Admin\Widget;
use Think\Controller;

class MenuWidget extends Controller
{
    //网页头部
    public function header(){

        $this->display('Menu:header');
    }
    //网页靠左菜单栏
    public function left(){
        //查询左边所拥有的值
        //一二三级
        $db = M('category');
        $arr = array(
            'level'=>0,
        );
        $first = $db->where($arr)->order('id')->select();
        $arr['level'] = 1;
        $second = $db->where($arr)->order('id')->select();
        $arr['level'] = 2;
        $thrid = $db->where($arr)->order('path')->select();

        $this->assign('first',$first);
        $this->assign('second',$second);
        $this->assign('thrid',$thrid);
        $this->display('Menu:left');
    }
}